SQL Antipatterns (for Amanda Dunlap) by Bill Karwin
Author:Bill Karwin
Language: eng
Format: epub
Tags: Pragmatic Bookshelf
ISBN: 1-934356-55-7
Publisher: The Pragmatic Bookshelf, LLC (212800)
SELECT * FROM Bugs WHERE assigned_to <> NULL;
The condition in a WHERE clause is satisfied only when the expression is true, but a comparison to NULL is never true; itâs unknown. It doesnât matter whether the comparison is for equality or inequality; itâs still unknown, which is certainly not true. Neither of the previous queries return rows where assigned_to is null.
Using Null in Query Parameters
Itâs also difficult to use null in a parameterized SQL expression as if the null were an ordinary value.
Fear-Unknown/anti/parameter.sql
SELECT * FROM Bugs WHERE assigned_to = ?;
The previous query returns predictable results when you send an ordinary integer value for the parameter, but you canât use a literal NULL as the parameter.
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Access | Data Mining |
Data Modeling & Design | Data Processing |
Data Warehousing | MySQL |
Oracle | Other Databases |
Relational Databases | SQL |
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(8255)
Azure Data and AI Architect Handbook by Olivier Mertens & Breght Van Baelen(6402)
Building Statistical Models in Python by Huy Hoang Nguyen & Paul N Adams & Stuart J Miller(6360)
Serverless Machine Learning with Amazon Redshift ML by Debu Panda & Phil Bates & Bhanu Pittampally & Sumeet Joshi(6250)
Data Wrangling on AWS by Navnit Shukla | Sankar M | Sam Palani(6025)
Driving Data Quality with Data Contracts by Andrew Jones(5989)
Learning SQL by Alan Beaulieu(5956)
Machine Learning Model Serving Patterns and Best Practices by Md Johirul Islam(5758)
Weapons of Math Destruction by Cathy O'Neil(5719)
Big Data Analysis with Python by Ivan Marin(5169)
Data Engineering with dbt by Roberto Zagni(4192)
Solidity Programming Essentials by Ritesh Modi(3833)
Time Series Analysis with Python Cookbook by Tarek A. Atwan(3685)
Pandas Cookbook by Theodore Petrou(3400)
Blockchain Basics by Daniel Drescher(3271)
Hands-On Machine Learning for Algorithmic Trading by Stefan Jansen(2882)
Feature Store for Machine Learning by Jayanth Kumar M J(2794)
Learn T-SQL Querying by Pam Lahoud & Pedro Lopes(2776)
Mastering Python for Finance by Unknown(2728)
